<template>
	<view class="register">
		<image src="/static/register/background.png" class="background" mode=""></image>
		<image src="/static/register/logo.png" mode="" class="logo"></image>
		<view class="agreement">
			<view class="option" v-if="!isOption"></view>
			<image src="/static/register/select.png" class="select" v-else mode=""></image>
			阅读并同意
			<view class="text">《用户协议》</view>
		</view>
		<view class="btn" @click="gologin">
			微信登录
		</view>
	</view>
</template>

<script>
	import request from '@/request/index.js'
	export default {
		data() {
			return {
				
			}
		},
		methods: {
			gologin(){
									let that = this
				uni.login({
				  provider: 'weixin', //使用微信登录
				  success: function (loginRes) {
				    console.log(loginRes.code);
					request.post({
						url:'/api/wxLogin',
						data:{code:loginRes.code},
						success: res => {
							if (res.code == 200) {
								console.log('登录:', res.result)
							}
						}
					})
				  }
				});
			}
		}
	}
</script>

<style lang="scss">
	.register{
		width: 100vw;
		height: calc( 100vh - 88rpx);
		position: relative;
		.background{
			width: 100vw;
			height: 65vh;
			margin-top: -88rpx;
		}
		.logo{
			width: 110rpx;
			height: 100rpx;
			position: absolute;
			top: 364rpx;
			right: 64rpx;
		}
		.agreement{
			display: flex;
			justify-content: center;
			align-items: center;
			margin-top: 160rpx;
			font-size: 20rpx;
			color: #9E9E9E;
			.option{
				width: 24rpx;
				height: 24rpx;
				border: 1rpx solid #e5e5e5;
				border-radius: 50%;
				margin-right: 12rpx;
			}
			.text{
				color: #275BA8;
			}
		}
		.btn{
			width: 480rpx;
			height: 108rpx;
			background: #275BA8;
			border-radius: 106rpx;
			font-size: 40rpx;
			color: #FFFFFF;
			line-height: 108rpx;
			text-align: center;
			margin: 0 auto;
			margin-top: 20rpx;
		}
	}
</style>